using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CityRoad : MonoBehaviour
{
    [SerializeField] Transform mCityPosA;
    [SerializeField] Transform mCityPosB;
    

    [ContextMenu("Execute")]
    private void Execute()
    {
        var dir = (mCityPosB.position - mCityPosA.position);
        var dirn = dir.normalized;
        var d = dir.magnitude;
        transform.right = dirn;
        var scale = transform.localScale;
        scale.x = d;
        transform.localScale = scale;
        transform.position = (mCityPosB.position + mCityPosA.position) / 2f;
    }

    // Start is called before the first frame update
    void Start()
    {
        Execute();
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
